package com.probiz.estoresa.system.web.action;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;

import com.probiz.estore.common.model.system.Wrap;
import com.probiz.estore.core.controller.GenericStoreAdminController;
import com.probiz.estore.system.service.WrapManager;


public class WrapController extends GenericStoreAdminController<Wrap> {
    private WrapManager wrapManager = null;
    public void setWrapManager(WrapManager wrapManager) {
        this.wrapManager = wrapManager;
    }
   
    public ModelAndView defaultAction(HttpServletRequest request,
                                      HttpServletResponse response){
       return super.search(request, response);	
	
    }    
    
	@Override
	protected String getEntityName(Wrap entity) {
		return entity.getWrapName();
	}


	@Override
	protected void initController() throws Exception {
		this.mgr = wrapManager;
		
	}
	
	@Override
	protected Map<String,String> getSortMap(){
		Map<String,String> sortMap = new HashMap<String,String>();
		sortMap.put("2", "convert_gbk(wrapName)");
		sortMap.put("3", "defaultPrice");
		return sortMap;
	}


	@Override
	protected void preSave(HttpServletRequest request, Wrap entity, BindException errors) {
		
	}    
  	  	
        
}
